//
//  BaseVC.swift
//  Xiaozihui
//
//  Created by 校企荟 on 2017/8/21.
//  Copyright © 2017年 校企荟. All rights reserved.
//

import UIKit

class BaseVC: UIViewController {

    var popClosure : ((_ networkFailed:Bool)->())?
    
    
    
    override func viewDidLoad() {
        super.viewDidLoad()
        let item = UIBarButtonItem(title: "", style: .plain, target: nil, action: nil)
        item.tintColor = #colorLiteral(red: 0.3529411765, green: 0.3529411765, blue: 0.3529411765, alpha: 1)
        navigationItem.backBarButtonItem = item
        
        view.backgroundColor = UIColor.white
        weak var weakSelf = self
        popClosure = { networkFailed in
            if  weakSelf?.navigationController?.childViewControllers.count as! Int  > 0 || networkFailed  {
                weakSelf?.navigationController?.popViewController(animated: true)
                ProgressHUD.showError(status: "请检查网络连接")
            }
        }
        setupUI()
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
      
        // Dispose of any resources that can be recreated.
    }
    
    
    func setupUI(){
    
    }

    deinit {
        print("\(self.classForCoder)被销毁了")
    }

}
